#!/usr/bin/env bash
# https://github.com/cirosantilli/linux-kernel-module-cheat#bisection
set -eu
cd ../..
./build-gem5 --gem5-build-id bisect
set +e
# Setup for quick failures:
# https://stackoverflow.com/questions/4713088/how-to-use-git-bisect/22592593#22592593
timeout 5 ./run --emulator gem5 --gem5-build-id bisect --quit-after-boot
if [ $? -ne 124 ]; then
  exit 1
fi
